Method and terminal for measuring angle

ABSTRACT

A method for a terminal to measure an angle, includes: displaying a horizontal reference line, a measurement line, and an object being imaged by a camera on a display interface of the terminal, a plane determined by the measurement line and the horizontal reference line being parallel with the display interface, and the measurement line being relatively static with respect to the display interface; during a process in which the terminal is turned to cause, on the display interface, an edge of the object to be parallel with the measurement line, obtaining one or more angles between the measurement line and the horizontal reference line; and determining an angle obtained when the edge of the object is parallel with the measurement line as an angle between the object and a horizontal plane.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a Continuation Application of InternationalApplication No. PCT/CN2014/089270, filed Oct. 23, 2014, which is basedupon and claims priority to Chinese Patent Application No.CN201410225638.5, filed May 26, 2014, the entire contents all of whichare incorporated herein by reference.

TECHNICAL FIELD

The present disclosure generally relates to the field of computertechnology and, more particularly, to a method and a terminal formeasuring an angle.

BACKGROUND

With the development of terminal technology, terminals have increasinglyversatile functions. For example, a gradienter application (APP) may beinstalled on a terminal, to detect whether the terminal is at ahorizontal level.

Conventionally, when an angle between the terminal and a horizontalplane is to be measured by the gradienter APP, the gradienter APP isinitiated by the terminal, and a measurement interface provided by thegradienter APP is displayed on the terminal. For example, themeasurement interface displays images showing liquid and a bubble in acontainer. During a movement of the terminal, the measurement interfacedisplays that the bubble keeps moving with the terminal. The anglebetween the terminal and the horizontal plane is determined to be 0 ifthe bubble is displayed to be located in a middle of the container.

SUMMARY

According to a first aspect of the present disclosure, there is provideda method for a terminal to measure an angle, comprising: displaying ahorizontal reference line, a measurement line, and an object beingimaged by a camera on a display interface of the terminal, a planedetermined by the measurement line and the horizontal reference linebeing parallel with the display interface, and the measurement linebeing relatively static with respect to the display interface; during aprocess in which the terminal is turned to cause, on the displayinterface, an edge of the object to be parallel with the measurementline, obtaining one or more angles between the measurement line and thehorizontal reference line; and determining an angle obtained when theedge of the object is parallel with the measurement line as an anglebetween the object and a horizontal plane.

According to second aspect of the present disclosure, there is provideda terminal, comprising: a processor; and a memory configured to storeinstructions executable by the processor; wherein the processor isconfigured to: display a horizontal reference line, a measurement line,and an object being imaged by a camera on a display interface of theterminal, a plane determined by the measurement line and the horizontalreference line being parallel with the display interface, and themeasurement line being relatively static with respect to the displayinterface; during a process in which the terminal is turned to cause, onthe display interface, an edge of the object to be parallel with themeasurement line, obtaining one or more angles between the measurementline and the horizontal reference line; and determining an angleobtained when the edge of the object is parallel with the measurementline as an angle between the object and a horizontal plane.

According to a third aspect of the present disclosure, there is provideda non-transitory computer-readable storage medium having stored thereininstructions that, when executed by a processor of a terminal, cause theterminal to perform a method for measuring an angle, the methodcomprising: displaying a horizontal reference line, a measurement line,and an object being imaged by a camera on a display interface of theterminal, a plane determined by the measurement line and the horizontalreference line being parallel with the display interface, and themeasurement line being relatively static in respect to the displayinterface; during a process in which the terminal is turned to cause, onthe display interface, an edge of the object to be parallel with themeasurement line, obtaining one or more angles between the measurementline and the horizontal reference line; and determining an angleobtained when the edge of the object is parallel with the measurementline as an angle between the object and a horizontal plane.

It should be understood that, the general description above and thedetailed description below are only exemplary, and do not limit thepresent disclosure.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings, which are incorporated in and constitute apart of this specification, illustrate embodiments consistent with theinvention and, together with the description, serve to explain theprinciples of the invention.

FIG. 1A is a flow chart of a method for measuring an angle, according toan exemplary embodiment.

FIG. 1B shows schematic views of a horizontal reference line and ameasurement line, according to an exemplary embodiment.

FIG. 1C is a schematic view showing a horizontal reference line and ameasurement line, according to an exemplary embodiment.

FIG. 2A is a flow chart of a method for measuring an angle, according toanother exemplary embodiment.

FIG. 2B is a schematic view showing a horizontal reference line and ameasurement line, according to an exemplary embodiment.

FIG. 2C shows schematic views of an angle measurement, according to anexemplary embodiment.

FIG. 3 is a block diagram of an apparatus for measuring an angle,according to an exemplary embodiment.

FIG. 4 is a block diagram of an apparatus for measuring an angle,according to an exemplary embodiment.

FIG. 5 is a block diagram of a device for measuring an angle, accordingto an exemplary embodiment.

DETAILED DESCRIPTION

Reference will now be made in detail to exemplary embodiments, examplesof which are illustrated in the accompanying drawings. The followingdescription refers to the accompanying drawings in which the samenumbers in different drawings represent the same or similar elementsunless otherwise represented. The implementations set forth in thefollowing description of exemplary embodiments do not represent allimplementations consistent with the disclosure. Instead, they are merelyexamples of apparatuses and methods consistent with aspects related tothe disclosure as recited in the appended claims.

FIG. 1A is a flow chart of a method 100 for measuring an angle,according to an exemplary embodiment. For example, the method 100 may beused by a terminal including a camera. Referring to FIG. 1, the method100 includes the following steps.

In step 101, a horizontal reference line, a measurement line, and anobject being imaged by the camera are displayed on a display interfaceof the terminal. For example, a plane determined according to themeasurement line and the horizontal reference line is parallel with thedisplay interface, and the measurement line is relatively static withrespect to the display interface.

In exemplary embodiments, the horizontal reference line is a referenceline configured to indicate a horizontal direction and keeps horizontal.The measurement line is configured to measure an angle between an objectand a horizontal plane and turns with the terminal. In the illustratedembodiment, the measurement line is relatively static with respect tothe display interface.

FIGS. 1B (1) and (2) are schematic views showing a horizontal referenceline 110 and a measurement line 112 on the display interface, accordingto an exemplary embodiment. Referring to FIGS. 1B (1) and (2), themeasurement line 112 is parallel with a side of the terminal. Since theside of the terminal is parallel with a horizontal plane and themeasurement line 112 is parallel with the side of the terminal, themeasurement line 112 is parallel with the horizontal reference line 110.For example, FIG. 1B (1) shows the display interface of the terminal ina portrait orientation, when the terminal is, e.g., a mobile phone, andFIG. 1B (2) shows the display interface of the terminal in a landscapeorientation, when the terminal is, e.g., a tablet. In FIGS. 1B (1) and(2), the horizontal reference line 110 is represented by a solid line,the measurement line 112 is represented by a dashed line, and thehorizontal plane is represented by a dash dotted line.

FIG. 1C is a schematic view showing the horizontal reference line 110and the measurement line 112 during measurement, according to anexemplary embodiment. There is an angle α between a long side of theterminal and the horizontal plane. Because the measurement line 112 isparallel with the long side of the terminal, the same angle α is betweenthe measurement line 112 and the horizontal reference line 110.

Referring back to FIG. 1A, in step 102, during a process in which theterminal is turned to cause, on the display interface, an edge of theobject to be parallel with the measurement line, one or more anglesbetween the measurement line and the horizontal reference line areobtained.

In exemplary embodiments, the measurement line is relatively static withrespect to the display interface and the horizontal reference line keepshorizontal. Therefore, during the turning of the terminal, an angle isformed between the measurement line and the horizontal reference line,and the angle is obtained.

In step 103, an angle obtained when the edge is parallel with themeasurement line is determined as an angle between the object and thehorizontal plane.

In exemplary embodiments, when the measurement line is parallel with theedge of the object, the angle between the measurement line and thehorizontal reference line is equal to the angle between the object andthe horizontal plane. Thus, the terminal determines the angle obtainedwhen the edge of the object is parallel with the measurement line as theangle between the object and the horizontal plane.

FIG. 2A is a flow chart of a method 200 for measuring an angle,according to an exemplary embodiment. In the illustrated embodiment, anapplication (APP) installed on a terminal having a camera is used tomeasure an angle between the terminal and a horizontal plane. Referringto FIG. 2A, the method 200 includes the following steps.

In step 201, it is detected whether the terminal is in an inclined stateand, if it is detected that the terminal is in the inclined state, thecamera is started.

In the illustrated embodiment, the terminal is aligned with an object tomeasure an angle of the object. If there is no angle between theterminal and the horizontal plane, it indicates that the object to bemeasured by the terminal is in the horizontal plane, and an anglebetween the object and the horizontal plane is 0°. Therefore, no anglemeasurement will be needed by the terminal. In order to avoid the wasteof resources by triggering a process of an angle measurement when thereis no angle measurement is needed, step 201 is performed to detectwhether the terminal is in the inclined state. If the terminal is in theinclined state, the process of the angle measurement is started, and theangle measurement is performed by starting the camera. If the terminalis in the horizontal plane, the process of the angle measurement is notstarted.

In exemplary embodiment, to detect whether the terminal is in theinclined state, an inclined angle between the terminal and thehorizontal plane is measured, and it is detected whether the inclinedangle falls into a preset angle range. If it is detected that theinclined angle falls into the preset angle range, it is determined thatthe terminal is in the inclined state.

In exemplary embodiments, when detecting whether the terminal is in theinclined state, the terminal may start a gradienter APP installed on theterminal, and the inclined angle between the terminal and the horizontalplane is measured by the gradienter APP. The inclined angle refers to anangle for a display interface of the terminal to rotate along a bottomside or a lateral side of the terminal, from the display interfacefacing upward and being parallel with the horizontal plane to being in acurrent posture. For example, the inclined angle of the terminal may bemeasured by the gradienter APP according to various well knowntechniques.

In exemplary embodiments, after acquiring the inclined angle measured bythe gradienter APP, the terminal compares the inclined angle with thepreset angle range. If the inclined angle falls into the preset anglerange, it is determined that the terminal is in the inclined state. Ifthe inclined angle does not fall into the preset angle range, it isdetermined that the terminal is in the horizontal state. The angle rangemay be set and modified. For example, the angle range may be set between45° and 135°, and may be modified to between 5° and 175°.

In step 202, a horizontal reference line, a measurement line, and theobject being imaged by the camera are displayed on the displayinterface. For example, a plane determined by the measurement line andthe horizontal reference line is parallel with the display interface,and the measurement line is relatively static with respect to thedisplay interface.

In exemplary embodiments, the horizontal reference line is a referenceline configured to indicate a horizontal direction and keeps horizontal.The measurement line is configured to measure an angle between an objectand a horizontal plane, and is relatively static with respect to thedisplay interface. There can be one or more measurement lines. In theillustrated embodiment, there is one measurement line.

In exemplary embodiments, the measurement line may be parallel with along side of the terminal (e.g., the measurement line 112 in FIG. 1B(2)), or a short site of the terminal (e.g., the measurement line 112 inFIG. 1B (1)). The measurement line may also not be parallel with a longside or short side of the terminal, as shown in FIG. 2B, which is aschematic view showing a horizontal reference line 210 and a measurementline 212. In the embodiment in connection with FIG. 2B, the long side ofthe terminal is parallel with the horizontal plane and the measurementline 212 is not parallel with the long side of the terminal. Therefore,the measurement line 212 is not parallel with the horizontal referenceline 210.

In exemplary embodiments, when the camera is in an ON state, the cameraimages the object in real time, and displays the object on the displayinterface.

Referring back to FIG. 2A, in step 203, during a process in which theterminal is turned to cause an edge of the object to be parallel withthe measurement line, one or more angles between the measurement lineand the horizontal reference line are obtained.

In exemplary embodiments, the measurement line is relatively static withrespective to the display interface and the horizontal reference linekeeps horizontal. Therefore, during the turning of the terminal, anangle is formed between the measurement line and the horizontalreference line, and the angle is measured by the gradienter APP in theillustrated embodiment.

In one exemplary embodiment, the measurement line is parallel with orcoincident with the horizontal reference line at an initial moment.Accordingly, a rotating angle of the measurement line with respect tothe horizontal reference line is measured, and the rotating angle isdetermined as the angle between the measurement line and the horizontalreference line.

In one exemplary embodiment, there is an initial angle between themeasurement line and the horizontal reference line at the initialmoment. Accordingly, the rotating angle of the measurement line withrespect to the horizontal reference line is measured, an angledifference is calculated by subtracting the initial angle from therotating angle, and the angle difference is determined as the anglebetween the measurement line and the horizontal reference line.

For example, if the measurement line is parallel with or coincident withthe horizontal reference line at the initial moment, the rotating angleof the measurement line relative to the horizontal reference line is arotating angle of the terminal relative to the horizontal plane. Thegradienter APP may measure the rotating angle of the terminal relativeto the horizontal plane, and the measured angle is determined as theangle between the measurement line and the horizontal reference line.Also for example, if there is an initial angle between the measurementline and the horizontal reference line at the initial moment, thegradienter APP acquires in advance the initial angle between theterminal and the horizontal plane before the user turns the terminal.Subsequently, the user turns the terminal, and stops turning of theterminal when the edge of the object being imaged by the camera isparallel with the measurement line on the display interface. Thegradienter APP then measures the rotating angle between the terminal andthe horizontal plane, and the angle between the measurement line and thehorizontal reference line is calculated by subtracting the initial anglefrom the rotating angle.

In exemplary embodiments, to indicate a current rotating angle to theuser, the gradienter APP measures the rotating angle at a predeterminedinterval, and displays the measured rotating angle on the displayinterface during the turning of the terminal.

In exemplary embodiments, the terminal determines that the edge of theobject is parallel with the measurement line, if the terminal is held bythe user at a certain position for a predetermined period. After theterminal detects that the terminal is held at a certain position for thepredetermined period, the edge of the object is determined to beparallel with the measurement line, and the gradienter APP is triggeredto calculate an angle. Alternatively, the terminal determines that theedge of the object is parallel with the measurement line, if theterminal receives a trigger signal from the user. When the terminalreceives the trigger signal, the edge of the object is determined to beparallel with the measurement line, and the gradienter APP is triggeredto calculate an angle. The trigger signal may be generated when a buttonprovided on the display interface is clicked, or a predetermined touchoperation on the display interface is performed, which is not limited inthe present disclosure.

In step 204, an angle obtained when the edge is parallel with themeasurement line is determined as an angle between the object and thehorizontal plane.

For example, when the measurement line is parallel with the edge of theobject, the angle between the measurement line and the horizontalreference line is the angle between the object and the horizontal plane.Thus, the terminal may determine the angle obtained when the edge of theobject is parallel with the measurement line, as the angle between theobject and the horizontal plane.

FIG. 2C is schematic views showing a measurement line 211 and ahorizontal reference line 212 displayed on the display interface of theterminal, according to an exemplary embodiment. In the illustratedembodiment, the measurement line 211 is parallel with a long side of theterminal and the preset angle range is from 10° to 170°.

In exemplary embodiments, before the user turns the terminal to bealigned with an object to be measured, an angle between the terminal andthe horizontal plane is 0<. Accordingly, the measurement line 211 andthe horizontal reference line 212 are displayed parallel with each otheron the display interface, as shown in FIG. 2C (1).

During a process in which the user turns the terminal to be aligned withthe object to be measured, the angle between the terminal and thehorizontal plane is measured by, e.g., the gradienter APP. When theangle between the terminal and the horizontal plane reaches 10°, whichfalls into the preset angle range from 10° to 170°, the terminal startsthe camera, and displays the object imaged by the camera in real time,in addition to the measurement line 211 and the horizontal referenceline 212. In the illustrated embodiment, it is assumed that the objectto be measured is a plate 214 reclining against a table 213, and bothare imaged by the camera, as shown in FIG. 2C (2).

When the user turns the terminal to cause an edge of the plate 214 to beparallel with the measurement line 211, an angle between the measurementline 211 and the horizontal reference line 212 is calculated to be 40°by, e.g., the gradienter APP. The 40° angle is determined as the anglebetween the plate 214 and the horizontal plane, and is displayed on thedisplay interface, as shown in FIG. 2C (3).

In exemplary embodiments, the terminal measures an angle between firstand second objects. For example, after the terminal performs steps 201to 204 a first time to measure an angle for the first object, such asthe plate 214, the terminal performs steps 201 to 204 a second time tomeasure an angle for the second object. To measure the angle for thesecond object, the terminal is turned to cause an edge of the secondobject to be parallel with the measurement line, and an angle betweenthe measurement line and the horizontal reference line during theturning is obtained and displayed. When the edge of the second object isparallel with the measurement line, the angle is determined as an anglebetween the second object and the horizontal plane. An angle differenceby subtracting the angle between the second object and the horizontalplane from the angle between the first object and the horizontal plane,and an absolute value of the angle difference is determined as the anglebetween the first object and the second object.

For example, if the measured angle between the first object and thehorizontal plane is 49° when the terminal performs steps 201 to 204 fora first time, and the angle between the second object and the horizontalplane is 13° when the terminal performs steps 201 to 204 for a secondtime, the angle between the first object and the second object isdetermined to be 36°.

FIG. 3 is a block diagram of an apparatus 300 for measuring an angleaccording to an exemplary embodiment. The apparatus 300 may be aterminal including a camera, or a part of the terminal. Referring toFIG. 3, the apparatus 300 includes a display module 301, an obtainingmodule 302, and a determining module 303.

The display module 301 is configured to display a horizontal referenceline, a measurement line, and an object being imaged by the camera on adisplay interface, a plane determined by the measurement line and thehorizontal reference line being parallel with the display interface, andthe measurement line being relatively static with respect to the displayinterface. The obtaining module 302 is configured to, during a processin which the terminal is turned to cause an edge of the object to beparallel with the measurement line, obtain an angle between themeasurement line and the horizontal reference line. The determiningmodule 303 is configured to determine an angle obtained by the obtainingmodule 302 when the edge is parallel with the measurement line, as anangle between the object and the horizontal plane.

FIG. 4 is a block diagram of an apparatus 400 for measuring an angle,according to an exemplary embodiment. The apparatus 400 may be aterminal including a camera, or a part of the terminal. Referring toFIG. 4, the apparatus 400 includes a display module 401, a firstobtaining module 402, and a first determining module 403.

The display module 401 is configured to display a horizontal referenceline, a measurement line, and an object being imaged by the camera on adisplay interface, a plane determined by the measurement line and thehorizontal reference line being parallel with the display interface, andthe measurement line being relatively static with respect to the displayinterface. The first obtaining module 402 is configured to, during aprocess in which the terminal is turned to cause an edge of the objectto be parallel with the measurement line, obtain an angle between themeasurement line and the horizontal reference line. The firstdetermining module 403 is configured to determine an angle obtained bythe first obtaining module 402 when the edge is parallel with themeasurement line as an angle between the object and the horizontalplane.

In exemplary embodiments, the display module 401 includes: a detectionunit 4011 and a display unit 4012. The detection unit 4011 is configuredto detect whether the terminal is in an inclined state. The display unit4012 is configured to start the camera, and to display the horizontalreference line, the measurement line, and the object being imaged by thecamera on the display interface, if the detection unit 4011 detects thatthe terminal is in the inclined state.

In exemplary embodiments, the detection unit 4011 includes a measurementsubunit 40111, a detection subunit 40112 and a determining subunit40113. The measurement subunit 40111 is configured to measure aninclined angle between the terminal and the horizontal plane. Thedetection subunit 40112 is configured to detect whether the inclinedangle detected by the measurement subunit 40111 falls into a presetangle range. The determination subunit 40113 is configured to determinethat the terminal is in the inclined state if it is detected that theinclined angle falls into the preset angle range.

In exemplary embodiments, the first obtaining module 402 includes afirst calculation unit 4021 and a second calculation unit 4022. Thefirst calculation unit 4021 is configured to, if the measurement line isparallel with or coincident with the horizontal reference line at aninitial moment, measure a rotating angle of the measurement line inrespect to the horizontal reference line, and to determine the rotatingangle as the angle between the measurement line and the horizontalreference line. The second calculation unit 4022 is configured to, ifthere is an initial angle between the measurement line and thehorizontal reference line at the initial moment, measure the rotatingangle of the measurement line in respect to the horizontal referenceline, calculate an angle difference by subtracting the initial anglefrom the rotating angle, and determine the angle difference as the anglebetween the measurement line and the horizontal reference line.

In exemplary embodiments, the apparatus 400 also includes a secondobtaining module 404, a second determining module 405, a calculationmodule 406, and a third determining module 407.

The second obtaining module 404 is configured to, if the camera images asecond object in addition to a first object, calculate an angle betweenthe measurement line and the horizontal reference line during a processin which the terminal is turned to cause an edge of the second object tobe parallel with the measurement line. The second determining module 405is configured to determine an angle obtained by the second obtainingmodule 404 when the edge of another object is parallel with themeasurement line as an angle between another object and the horizontalplane.

The calculation module 406 is configured to calculate an angledifference by subtracting the angle between the second object and thehorizontal plane from the angle between the first object and thehorizontal plane. The third determination module 407 is configured todetermine an absolute value of the angle difference as the angle betweenthe first object and the second object.

FIG. 5 is a block diagram of a device 500, according to an exemplaryembodiment. The device 500 is configured to perform the above describedmethods for measuring an angle. For example, the device 500 may be amobile phone, a computer, a digital broadcast terminal, a messagingdevice, a gaming console, a tablet, a medical device, exerciseequipment, a personal digital assistant, and the like.

Referring to FIG. 5, the device 500 may include one or more of thefollowing components: a processing component 502, a memory 504, a powercomponent 506, a multimedia component 508, an audio component 510, aninput/output (I/O) interface 512, a sensor component 514, and acommunication component 516.

The processing component 502 typically controls overall operations ofthe device 500, such as the operations associated with display,telephone calls, data communications, camera operations, and recordingoperations. The processing component 502 may include one or moreprocessors 518 to execute instructions to perform all or part of thesteps in the above described methods. Moreover, the processing component502 may include one or more modules which facilitate the interactionbetween the processing component 502 and other components. For instance,the processing component 502 may include a multimedia module tofacilitate the interaction between the multimedia component 508 and theprocessing component 502.

The memory 504 is configured to store various types of data to supportthe operation of the device 500. Examples of such data includeinstructions for any applications or methods operated on the device 500,contact data, phonebook data, messages, pictures, video, etc. The memory504 may be implemented using any type of volatile or non-volatile memorydevices, or a combination thereof, such as a static random access memory(SRAM), an electrically erasable programmable read-only memory (EEPROM),an erasable programmable read-only memory (EPROM), a programmableread-only memory (PROM), a read-only memory (ROM), a magnetic memory, aflash memory, a magnetic or optical disk.

The power component 506 may include a power management system, one ormore power sources, and any other components associated with thegeneration, management, and distribution of power in the device 500.

The multimedia component 508 includes a screen providing an outputinterface between the device 500 and the user. In some embodiments, thescreen may include a liquid crystal display (LCD) and a touch panel(TP). If the screen includes the touch panel, the screen may beimplemented as a touch screen to receive input signals from the user.The touch panel includes one or more touch sensors to sense touches,swipes, and gestures on the touch panel. The touch sensors may not onlysense a boundary of a touch or swipe action, but also sense a period oftime and a pressure associated with the touch or swipe action. In someembodiments, the multimedia component 508 includes a front camera and/ora rear camera. The front camera and the rear camera may receive anexternal multimedia datum while the device 500 is in an operation mode,such as a photographing mode or a video mode. Each of the front cameraand the rear camera may be a fixed optical lens system or have focus andoptical zoom capability.

The audio component 510 is configured to output and/or input audiosignals. For example, the audio component 510 includes a microphoneconfigured to receive an external audio signal when the device 500 is inan operation mode, such as a call mode, a recording mode, and a voicerecognition mode. The received audio signal may be further stored in thememory 504 or transmitted via the communication component 516. In someembodiments, the audio component 510 further includes a speaker tooutput audio signals.

The I/O interface 512 provides an interface between the processingcomponent 502 and peripheral interface modules, such as a keyboard, aclick wheel, buttons, and the like. The buttons may include, but are notlimited to, a home button, a volume button, a starting button, and alocking button.

The sensor component 514 includes one or more sensors to provide statusassessments of various aspects of the device 500. For instance, thesensor component 514 may detect an open/closed status of the device 500,relative positioning of components, e.g., the display and the keypad, ofthe device 500, a change in position of the device 500 or a component ofthe device 500, a presence or absence of user contact with the device500, an orientation or an acceleration/deceleration of the device 500,and a change in temperature of the device 500. The sensor component 514may include a proximity sensor configured to detect the presence ofnearby objects without any physical contact. The sensor component 514may also include a light sensor, such as a CMOS or CCD image sensor, foruse in imaging applications. In some embodiments, the sensor component514 may also include an accelerometer sensor, a gyroscope sensor, amagnetic sensor pressure sensor temperature sensor.

The communication component 516 is configured to facilitatecommunication, wired or wirelessly, between the device 500 and otherdevices. The device 500 can access a wireless network based on acommunication standard, such as WiFi, 2G, or 3G, or a combinationthereof. In one exemplary embodiment, the communication component 516receives a broadcast signal or broadcast associated information from anexternal broadcast management system via a broadcast channel. In oneexemplary embodiment, the communication component 516 further includes anear field communication (NFC) module to facilitate short-rangecommunications. For example, the NFC module may be implemented based ona radio frequency identification (RFID) technology, an infrared dataassociation (IrDA) technology, an ultra-wideband (UWB) technology, aBluetooth (BT) technology, and other technologies.

In exemplary embodiments, the device 500 may be implemented with one ormore application specific integrated circuits (ASICs), digital signalprocessors (DSPs), digital signal processing devices (DSPDs),programmable logic devices (PLDs), field programmable gate arrays(FPGAs), controllers, micro-controllers, microprocessors, or otherelectronic components, for performing the above described methods.

In exemplary embodiments, there is also provided a non-transitorycomputer-readable storage medium including instructions, such asincluded in the memory 504, executable by the processor 518 in thedevice 500, for performing the above-described methods. For example, thenon-transitory computer-readable storage medium may be a ROM, a RAM, aCD-ROM, a magnetic tape, a floppy disc, an optical data storage device,and the like.

One of ordinary skill in the art will understand that the abovedescribed modules/units can each be implemented by hardware, orsoftware, or a combination of hardware and software. One of ordinaryskill in the art will also understand that multiple ones of the abovedescribed modules/units may be combined as one module/unit, and each ofthe above described modules/units may be further divided into aplurality of sub-modules/sub-units.

Other embodiments of the disclosure will be apparent to those skilled inthe art from consideration of the specification and practice of thedisclosure disclosed here. This application is intended to cover anyvariations, uses, or adaptations of the disclosure following the generalprinciples thereof and including such departures from the presentdisclosure as come within known or customary practice in the art. It isintended that the specification and examples be considered as exemplaryonly, with a true scope and spirit of the disclosure being indicated bythe following claims.

It will be appreciated that the present disclosure is not limited to theexact construction that has been described above and illustrated in theaccompanying drawings, and that various modifications and changes can bemade without departing from the scope thereof. It is intended that thescope of the disclosure only be limited by the appended claims.

What is claimed is:
 1. A method for a terminal to measure an angle,comprising: displaying a horizontal reference line, a measurement line,and an object being imaged by a camera on a display interface of theterminal, a plane determined by the measurement line and the horizontalreference line being parallel with the display interface, and themeasurement line being relatively static with respect to the displayinterface; during a process in which the terminal is turned to cause, onthe display interface, an edge of the object to be parallel with themeasurement line, obtaining one or more angles between the measurementline and the horizontal reference line; and determining an angleobtained when the edge of the object is parallel with the measurementline as an angle between the object and a horizontal plane.
 2. Themethod according to claim 1, wherein the displaying of the horizontalreference line, the measurement line, and the object comprises:detecting whether the terminal is in an inclined state; and if it isdetected that the terminal is in the inclined state, starting thecamera, and displaying the horizontal reference line, the measurementline, and the object being imaged by the camera on the displayinterface.
 3. The method according to claim 2, wherein the detecting ofwhether the terminal is in an inclined state comprises: measuring aninclined angle between the terminal and the horizontal plane; detectingwhether the inclined angle falls into a preset angle range; and if it isdetected that the inclined angle Falls into the preset angle range,determining that the terminal is in the inclined state.
 4. The methodaccording to claim 1, wherein the obtaining of a first angle of the oneor more angles between the measurement line and the horizontal referenceline comprises: if the measurement line is parallel with or coincidentwith the horizontal reference line at an initial moment, measuring arotating angle of the measurement line with respect to the horizontalreference line, and determining the rotating angle as the first anglebetween the measurement line and the horizontal reference line; and ifthere is an initial angle between the measurement line and thehorizontal reference line at the initial moment, measuring the rotatingangle of the measurement line with respect to the horizontal referenceline, calculating an angle difference by subtracting the initial anglefrom the rotating angle, and determining the angle difference as thefirst angle between the measurement line and the horizontal referenceline.
 5. The method according to claim 2, wherein the obtaining of afirst angle of the one or more angles between the measurement line andthe horizontal reference line comprises: if the measurement line isparallel with or coincident with the horizontal reference line at aninitial moment, measuring a rotating angle of the measurement line withrespect to the horizontal reference line, and determining the rotatingangle as the first angle between the measurement line and the horizontalreference line; and if there is an initial angle between the measurementline and the horizontal reference line at the initial moment, measuringthe rotating angle of the measurement line with respect to thehorizontal reference line, calculating an angle difference bysubtracting the initial angle from the rotating angle, and determiningthe angle difference as the first angle between the measurement line andthe horizontal reference line.
 6. The method according to claim 3,wherein the obtaining of a first angle of the one or more angles betweenthe measurement line and the horizontal reference line comprises: if themeasurement line is parallel with or coincident with the horizontalreference line at an initial moment, measuring a rotating angle of themeasurement line with respect to the horizontal reference line, anddetermining the rotating angle as the first angle between themeasurement line and the horizontal reference line; and if there is aninitial angle between the measurement line and the horizontal referenceline at the initial moment, measuring the rotating angle of themeasurement line with respect to the horizontal reference line,calculating an angle difference by subtracting the initial angle fromthe rotating angle, and determining the angle difference as the firstangle between the measurement line and the horizontal reference line. 7.The method according to claim 1, wherein the object is a first objectand, when the camera images a second object, the method furthercomprising: during process in which the terminal is turned to cause, onthe display interface, an edge of the second object to be parallel withthe measurement line, obtaining one or more angles between themeasurement line and the horizontal reference line; determining an angleobtained when the edge of the second object is parallel with themeasurement line as an angle between the second object and thehorizontal plane; calculating an angle difference by subtracting theangle between the second object and the horizontal plane from the anglebetween the first object and the horizontal plane; and determining anabsolute value of the angle difference as an angle between the firstobject and the second object.
 8. A terminal, comprising: a processor;and a memory configured to store instructions executable by theprocessor; wherein the processor is configured to: display a horizontalreference line, a measurement line, and an object being imaged by acamera on a display interface of the terminal, a plane determined by themeasurement line and the horizontal reference line being parallel withthe display interface, and the measurement line being relatively staticwith respect to the display interface; during a process in which theterminal is turned to cause, on the display interface, an edge of theobject to be parallel with the measurement line, obtaining one or moreangles between the measurement line and the horizontal reference line;and determining an angle obtained when the edge of the object isparallel with the measurement line as an angle between the object and ahorizontal plane.
 9. The terminal according to claim 8, wherein theprocessor is further configured to: detect whether the terminal is in aninclined state; and if it is detected that the terminal is in theinclined state, start the camera, and display the horizontal referenceline, the measurement line, and the object being imaged by the camera onthe display interface.
 10. The terminal according to claim 9, whereinthe processor is further configured to: measure an inclined anglebetween the terminal and the horizontal plane; detect whether theinclined angle thus into a preset angle range; and if it is detectedthat the inclined angle falls into the preset angle range, determinethat the terminal is in the inclined state.
 11. The terminal accordingto claim 8, wherein the processor is further configured to: if themeasurement line is parallel with or coincident with the horizontalreference line at an initial moment, measure a rotating angle of themeasurement line with respect to the horizontal reference line, anddetermine the rotating angle as a first one of the one or more anglesbetween the measurement line and the horizontal reference line; and ifthere is an initial angle between the measurement line and thehorizontal reference line at the initial moment, measure the rotatingangle of the measurement line with respect to the horizontal referenceline, calculate an angle difference by subtracting the initial anglefrom the rotating angle, and determine the angle difference as the firstone of the one or more angles between the measurement line and thehorizontal reference line.
 12. The terminal according to claim 9,wherein the processor is further configured to: if the measurement lineis parallel with or coincident with the horizontal reference line at aninitial moment, measure a rotating angle of the measurement line withrespect to the horizontal reference line, and determine the rotatingangle as a first one of the one or more angles between the measurementline and the horizontal reference line; and if there is an initial anglebetween the measurement line and the horizontal reference line at theinitial moment, measure the rotating angle of the measurement line withrespect to the horizontal reference line, calculate an angle differenceby subtracting the initial angle from the rotating angle, and determinethe angle difference as the first one of the one or more angles betweenthe measurement line and the horizontal reference line.
 13. The terminalaccording to claim 10, wherein the processor is further configured to:if the measurement line is parallel with or coincident with thehorizontal reference line at an initial moment, measure a rotating angleof the measurement line with respect to the horizontal reference line,and determine the rotating angle as a first one of the one or moreangles between the measurement line and the horizontal reference line;and if there is an initial angle between the measurement line and thehorizontal reference line at the initial moment, measure the rotatingangle of the measurement line with respect to the horizontal referenceline, calculate an angle difference by subtracting the initial anglefrom the rotating angle, and determine the angle difference as the firstone of the one or more angles between the measurement line and thehorizontal reference line.
 14. The terminal according to claim 8,wherein the object is a first object and, when the camera images asecond object, the processor is further configured to: during a processin which the terminal is turned to cause, on the display interface, anedge of the second object to be parallel with the measurement line,obtain one or more angles between the measurement line and thehorizontal reference line; determine an angle obtained when the edge ofthe second object is parallel with the measurement line as an anglebetween the second object and the horizontal plane; calculate an angledifference by subtracting the angle between the second object and thehorizontal plane from the angle between the first object and thehorizontal plane; and determine an absolute value of the angledifference as an angle between the first object and the second object.15. A non-transitory computer-readable storage medium having storedtherein instructions that, when executed by a processor of a terminal,cause the terminal to perform a method for measuring an angle, themethod comprising: displaying a horizontal reference line, a measurementline, and an object being imaged by a camera on a display interface ofthe terminal, a plane determined by the measurement line and thehorizontal reference line being parallel with the display interface, andthe measurement line being relatively static in respect to the displayinterface; during a process in which the terminal is turned to cause, onthe display interface, an edge of the object to be parallel with themeasurement line, obtaining one or more angles between the measurementline and the horizontal reference line; and determining an angleobtained when the edge of the object is parallel with the measurementline as an angle between the object and a horizontal plane.
 16. Thenon-transitory computer-readable storage medium according to claim 15,wherein the displaying of the horizontal reference line, the measurementline, and the object comprises: detecting whether the terminal is in aninclined state; and if it is detected that the terminal is in theinclined state, starting the camera, and displaying the horizontalreference line, the measurement line, and the object being imaged by thecamera on the display interface.
 17. The non-transitorycomputer-readable storage medium according to claim 16, wherein thedetecting of whether the terminal is in an inclined state comprises:measuring an inclined angle between the terminal and the horizontalplane; detecting whether the inclined angle falls into a preset anglerange; and if it is detected that the inclined angle falls into thepreset angle range, determining that the terminal is in the inclinedstate.
 18. The non-transitory computer-readable storage medium accordingto claim 15, wherein the obtaining of a first angle of the one or moreangles between the measurement line and the horizontal reference linecomprises: if the measurement line is parallel with or coincident withthe horizontal reference line at an initial moment, measuring a rotatingangle of the measurement line with respect to the horizontal referenceline, and determining the rotating angle as the first angle between themeasurement line and the horizontal reference line; and if there is aninitial angle between the measurement line and the horizontal referenceline at the initial moment, measuring the rotating angle of themeasurement line with respect to the horizontal reference line,calculating an angle difference by subtracting the initial angle fromthe rotating angle, and determining the angle difference as the firstangle between the measurement line and the horizontal reference line.19. The non-transitory computer-readable storage medium according toclaim 16, wherein the obtaining of a first angle of the one or moreangles between the measurement line and the horizontal reference linecomprises: if the measurement line is parallel with or coincident withthe horizontal reference line at an initial moment, measuring a rotatingangle of the measurement line with respect to the horizontal referenceline, and determining the rotating angle as the first angle between themeasurement line and the horizontal reference line; and if there is aninitial angle between the measurement line and the horizontal referenceline at the initial moment, measuring the rotating angle of themeasurement line with respect to the horizontal reference line,calculating an angle difference by subtracting the initial angle fromthe rotating angle, and determining the angle difference as the firstangle between the measurement line and the horizontal reference line.20. The non-transitory computer-readable storage medium according toclaim 15, wherein the object is a first object and, when the cameraimages a second object, the method further comprises: during a processin which the terminal is turned to cause an edge of the second object tobe parallel with the measurement line, obtaining one or more anglesbetween the measurement line and the horizontal reference line;determining an angle obtained when the edge of the second object isparallel with the measurement line as an angle between the second objectand the horizontal plane; calculating an angle difference by subtractingthe angle between the second object and the horizontal plane from theangle between the first object and the horizontal plane; and determiningan absolute value of the angle difference as an angle between the firstobject and the second object.